home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Plus / Multimedia Plus with ClearVue Version 10-94 (Knowledge Media Inc.).ISO / dos / fractal / yabmp097 / yabmp.doc < prev    next >
Text File  |  1992-11-21  |  45KB  |  827 lines

  1.                             YABMP.DOC ver. 0.97 
  2.  
  3.                          ( for i486 or i386/387 )
  4.     
  5.  
  6.         Part 1. Introduction 
  7.                 ____________ 
  8.  
  9.  
  10.         1.0. Hardware Requirements
  11.              ---------------------
  12.  
  13.         YABMP is a 32-bit Protected Mode program that requires an 
  14.         i486 CPU (or an i386 CPU with i387 FPU). It runs under DOS 
  15.         ( version 3.3? or greater ) with a DOS Extender, which is
  16.         provided. 
  17.  
  18.         YABMP requires a VGA or SuperVGA Color Graphics Card and a 
  19.         Color Monitor. Six VGA/SVGA modes are supported: 640 x 480,
  20.         800 x 600, and 1024 x 768 in both 256 and 16 colors. YABMP
  21.         has been tested with ATI Wonder XL, ATI Graphics Ultra, and
  22.         Paradise PVGA 1024 Video Cards, but the VGA modes should work 
  23.         with most cards. 
  24.         
  25.         YABMP supports printing its figures with the Hewlett-Packard 
  26.         LaserJet (tm) II or III. 
  27.  
  28.                
  29.         1.1.  Why Yet Another Brooks-Matelski Process Program? 
  30.               ------------------------------------------------ 
  31.        
  32.         Many programs are already available to compute and plot the MSet 
  33.         (the so-called "Mandelbrot Set") and its associated JSets. Their 
  34.         aim, however, often appears to be to produce these figures as a 
  35.         kind of art or entertainment and their results are often mathe-
  36.         matically inaccurate and tend to obscure, rather than to 
  37.         reveal and to clarify, the underlying mathematics. The aim of 
  38.         YABMP is to produce the most mathematically accurate figures 
  39.         of the MSet and of its associated JSets. 
  40.         
  41.         The visually (and mathematically!) most striking feature of the 
  42.         MSet is that it contains infinitely many small copies of itself, 
  43.         imbedded in itself near its boundary. A first requisite of a good 
  44.         MSet figure is that these be conspicuous. 
  45.         
  46.         A second aspect of mathematical accuracy is the aspect-ratio 
  47.         (i.e., the proportions) of the figure. That is, a square in the 
  48.         complex plane must appear as a square in the figure. This means 
  49.         that we are not free to specify all four corners of a rectangular 
  50.         region in the plane. YABMP asks you only for the coordinates of 
  51.         the center of the desired figure and its height --- the 
  52.         appropriate width being determined so that the figure has the 
  53.         correct aspect-ratio. 
  54.  
  55.         A third aspect of mathematical accuracy concerns the coloring of 
  56.         the figure. There are, in principle, only two kinds of points in 
  57.         these figures: There are points that belong to the set and there 
  58.         are points that belong to the complement of the set. Thus, the 
  59.         most mathematically accurate figures should require only two 
  60.         colors. In practice, however, a third color is required for 
  61.         pixels that correspond to points which lie very near the boundary 
  62.         of the set. If you have not seen them before, you will be 
  63.         astonished by the stark beauty of the three-color figures YABMP 
  64.         produces.  
  65.                                  
  66.  
  67.         1.2.  The YABMP Distribution 
  68.               ---------------------
  69.  
  70.         This YABMP distribution consists of the following 7 files:      
  71.  
  72.             YABMP.EXE     Requires an i486 CPU (or i386DX CPU with 
  73.                           i387DX FPU). 
  74.         
  75.             CPUID.ZIP     Intel program to correctly determine your 
  76.                           CPU and FPU, before attempting to run YABMP.  
  77.  
  78.             DOS4GW.EXE    Rational Systems (tm) DOS Extender. Must be 
  79.                           in the current directory or a pathed 
  80.                           directory.          
  81.          
  82.             YABMP.HLP     Help File containing brief instructions to 
  83.                           be viewed from within YABMP. 
  84.         
  85.             YABMP.DOC     This Documentation File. 
  86.         
  87.             YABMPCMD.ZIP  Collection of *.CMD script files for auto-
  88.                           matically producing and saving the figures 
  89.                           referred to in this documentation. 
  90.         
  91.             YABMPPAL.ZIP  Collection of *.PAL palette files. 
  92.  
  93.         1.3.  Installation 
  94.               ------------ 
  95.         
  96.         YABMP looks for all of its files (DOS4GW.EXE, BMPSCRN.CFG, 
  97.         YABMP.HLP, the *.BMP Figure Files it produces, the *.CMD 
  98.         script, and the *.PAL palette files) in the current directory. 
  99.         Just copy all of the distribution files to a single 
  100.         subdirectory on your fixed disk and run YABMP from that 
  101.         subdirectory. 
  102.             
  103.         
  104.         1.4.  File Compression and Printing Figures 
  105.               -------------------------------------
  106.         
  107.         YABMP provides no data compression. Even the very best data 
  108.         compression and decompression routines take a significant time to 
  109.         process the very large figure files that YABMP can generate. 
  110.         Most figures are generated so quickly that it is not 
  111.         worthwhile to save them beyond the current session. If you 
  112.         should generate figures you want to keep, you can compress 
  113.         them with PKZIP (tm) and decompress them for viewing. 
  114.         
  115.         YABMP is intended for use in exploring the MSet and its 
  116.         associated JSets and quick producing accurate detail figures 
  117.         for viewing. Data concerning a figure, which is displayed 
  118.         before a recalled figure file is displayed, is displayed in 
  119.         text mode and can be printed with PrintScreen. 
  120.         
  121.         Screen figures and figures printed from the screen can both 
  122.         have the correct aspect ratio only if both screen and printer 
  123.         pixels have the same proportions and, therefore, printing the 
  124.         screen correctly is problematical.  
  125.         
  126.         YABMP supports printing its figures with the Hewlett-Packard 
  127.         LaserJet II or III. Output may be directed to either LPT1:, to
  128.         an H-P .PCL File, or to an .HP file.
  129.  
  130.         If you do not have a LaserJet connected to LPT1:, make an 
  131.         H-P .PCL file and send it to a LaserJet later with the DOS 
  132.         command:   COPY name.PCL LPT1:/B, which produces the same 
  133.         result as sending output directly to LPT1:.  An *.HP file is 
  134.         intended for inclusion in a document formatted with the TeX 
  135.         typesetting system, using the TeX "special" command. 
  136.      
  137.         A conventional Graphics PrintScreen utility will print a solid 
  138.         black rectangle, since every pixel on the YABMP screen is 
  139.         colored. A PrintScreen utility, that can be gotten to print only 
  140.         Color 2, in the current mode, can also print YABMP figures. 
  141.         
  142.  
  143.         Part 2. Using YABMP 
  144.                 ----------
  145.         
  146.         2.0 General. 
  147.             -------
  148.  
  149.         When you first run YABMP, a Default Graphics Mode Selection 
  150.         Screen will appear. The six VGA and SuperVGA graphics modes, 
  151.         that are supported by YABMP, will be displayed. Those that appear 
  152.         to also be supported by your hardware are highlighted in red. 256 
  153.         color graphics run faster than 16 color graphics and the 
  154.         resulting files can be compressed more. On the other the 
  155.         other hand, files generated in 256 color modes are twice as 
  156.         large as those produced in the 16 color mode of the same 
  157.         resolution. Thus, for exploration, when you do not intend to 
  158.         save the generated figures, YABMP Mode 2 ( 640 x 480 x 256 ) is 
  159.         the preferred mode. The higher resolution SuperVGA modes ( 800 x 
  160.         600 and 1024 x 768 ) run slower and produce larger files, but 
  161.         generally do not produce commensurately more attractive figures 
  162.         on the screen. They are useful mainly for producing figures to 
  163.         be printed. Select a default graphics mode (Enter 1 or 2). Then 
  164.         save the selected mode by entering y. You can change your default 
  165.         Graphics Mode, either permanently or temporarily, from the Options 
  166.         Menu (Item 1).  
  167.                        
  168.         In its interactive mode, YABMP is operated from three menus. 
  169.         First, there is the Main MENU, which comes up when the program is 
  170.         run. Second, there is the Options Menu, which is Item (5) on 
  171.         the Main MENU. Finally, there is the Small Menu, which appears 
  172.         at the top of computed or recalled figures. 
  173.         
  174.         You can generally escape from whatever you are doing by pressing 
  175.         Esc **ONCE**. This will usually return you to the previous menu 
  176.         or display or to the Main MENU. Pressing Esc will also interrupt 
  177.         computation and plotting, but this command does not take effect 
  178.         until YABMP finishes plotting the current row of pixels.  You can 
  179.         also interrupt computation and plotting by pressing Enter. This 
  180.         allows you to save a partially completed figure, which can be 
  181.         completed later. 
  182.  
  183.  
  184.         2.1 Getting Started Quickly.
  185.             ----------------------- 
  186.         
  187.         A collection of YABMP script files is provided for generating the 
  188.         figures referred to in this documentation.  To see how a script 
  189.         file works, enter YABMP &JSETI.CMD. A JSet figure should be 
  190.         plotted and saved to your current directory as JSETI.BMP. 
  191.         After YABMP exits, follow the instructions in the following 
  192.         paragraph to view your figure. 
  193.                       
  194.                                 
  195.         2.2. Viewing an existing figure file. Item (2) of Main MENU. 
  196.              -------------------------------
  197.         
  198.         A list of existing figure files, in the current directory, is 
  199.         displayed. Select the desired file by entering its number. 
  200.         
  201.         Data on the selected file is displayed and this may be printed 
  202.         with the PrintScrn key. 
  203.         
  204.         If the file is an only partially completed figure, you may elect 
  205.         to finish it. Otherwise, press any key to display the file and a 
  206.         Small Menu will appear. If key 'c' or 'C' is pressed at this 
  207.         point to continue, then a command file for making this figure, 
  208.         named CMD_n.CMD --- where n is a number, is written to your 
  209.         current directory. 
  210.         
  211.         F2 Display just removes the Small Menu. Press any key to restore 
  212.         the Small Menu. 
  213.         
  214.         F4 Zoom produces a box for selecting a subregion of the figure, 
  215.         to compute and plot. Move the box about with the Cursor keys and 
  216.         adjust the size of the box with PageUp and PageDown. Using the
  217.         cursor and PageUp and Page Down keys on the numeric keypad (with
  218.         NumLock set, so the keys are actually the numerals 2, 4, 6, 8, 3, 
  219.         and 9) adjusts the box more rapidly. Press Enter to select a 
  220.         region or Esc to return to the small menu. If you select a 
  221.         region, you will have an opportunity to edit several   
  222.         parameters. The sequence, from this point, is the same as if 
  223.         you had selected a subregion of a freshly computed figure and 
  224.         is described below. 
  225.         
  226.         F5 Measure produces a graphics cursor (crosshairs) to read the 
  227.         true coordinates of a point in a figure. Move it about with the 
  228.         cursor and PageUp/PageDown keys or the keys on the numeric keypad. 
  229.         Return to the Small Menu with Esc.  Press Enter to compute and 
  230.         display the period of the point, corresponding to the cursor 
  231.         location. If the figure is an MSet figure, Press j or J to 
  232.         make a JSet figure, using the cursor location as c. 
  233.         
  234.         F6 Ray draws external rays over the figure. 
  235.  
  236.         F7 Done returns to the list of existing figure files. The 
  237.         directory is not read again, at this point, so any figure 
  238.         files you have just made will not appear. To see these, Press 
  239.         Esc, to Return to the Main MENU, and then select (2) View an 
  240.         Existing File again. 
  241.                                                      
  242.          
  243.         2.3. Making a New MSet Figure. Item (3) of Main MENU. 
  244.              ------------------------
  245.         
  246.         Begin by entering the parameters on which the computation 
  247.         depends. 
  248.         
  249.         The desired region of the plane is specified by the coordinates 
  250.         of the center of the figure, which are ( x_center, y_center ), 
  251.         and the height of the figure, which is ymax - ymin. The program 
  252.         determines the width = xmax - xmin of the region, according to 
  253.         the aspect-ratio, so that the figure is always automatically 
  254.         proportioned correctly. See Checking the Aspect Ratio, under 
  255.         Options Menu below. 
  256.  
  257.         Default values of the parameters, for the full MSet Figure, are 
  258.         given on the data entry screen. To accept a default value, just 
  259.         Press Enter. 
  260.                                                          
  261.            "thickness" is related to the width in pixels of the region 
  262.            near the boundary (plotted in yellow). If the thickness is too 
  263.            small, a figure that should be connected may be plotted 
  264.            disconnected. If the thickness is too large, "holes" in the 
  265.            figure, that should be plotted in blue, may be filled in as 
  266.            points near the boundary. Thickness = 0.25 produces a good 
  267.            figure of the full MSet. Smaller values, down to about 
  268.            thickness = 0.1, or less, are be required for some high-
  269.            magnification details. Recall that the MSet is connected, so a 
  270.            good MSet figure must look connected. Too small a value of 
  271.            thickness will disconnect the figure. Too large a value of 
  272.            thickness will result in fat tendrils and filled-in holes. 
  273.  
  274.            "maxiter" is the maximum number of iterations to be made. 
  275.            maxiter = 110 is sufficient for the full MSet figure and 
  276.            larger values will not make a significantly better figure. 
  277.            However, high-magnification details often require 10000 or 
  278.            more. If maxiter is set too small, many points that will 
  279.            eventually escape will not yet have escaped. These will be 
  280.            colored red, as interior points of the set, rather than 
  281.            yellow as they should be. If increasing maxiter does not 
  282.            reduce the red area further, then maxiter should be 
  283.            sufficiently large. 
  284.  
  285.            "maxperiod" is the maximum period length checked for points in 
  286.            the interior of the MSet (i.e., red points). When a stably 
  287.            periodic point is detected, its distance from the boundary can 
  288.            be computed and the distance can be used to color an entire 
  289.            disk, rather than just a single pixel. maxperiod = 10 is 
  290.            sufficient for the full MSet. In plotting a detail, if you see 
  291.            many red pixels being plotted one at a time, try raising the 
  292.            value of maxperiod. But, setting maxperiod too high slows 
  293.            the program and it cannot do any good with small values of 
  294.            maxiter. The setting of maxperiod generally has no effect on 
  295.            the figure produced. The measure function (see F5 on the Small 
  296.            Menu, below) is provided for determining a suitable value of 
  297.            maxperiod. 
  298.  
  299.            "minrecur" is the minimum radius of disks plotted, before 
  300.            recursion is terminated. minrecur = 1 results in the fastest 
  301.            plotting and generally produces a satisfactory figure. 
  302.  
  303.         After these parameters have been entered, select the desired 
  304.         Complement Coloring Scheme. The main purpose of this program is 
  305.         to provide (1) Solid Complement and Solid Interior, and (2) 
  306.         Distance (disks) Complement and Solid Interior, which result in 
  307.         the best figures and the shortest computation time. The remaining 
  308.         schemes are provided mainly for comparison purposes. 
  309.         
  310.            "Coloring Scheme". The cleanest and best-looking figures are 
  311.            made in the shortest time with color scheme (1) Solid 
  312.            Complement and Solid Interior, which colors the complement 
  313.            solid dark blue, or with color scheme (2) Distance (disks) 
  314.            Complement and Solid Interior, which colors the complement in 
  315.            slightly different shades of dark blue. These choices are 
  316.            highlighted in red and should normally be used. Several other 
  317.            familiar color schemes are provided. Color scheme (6) Solid 
  318.            Complement with Interior by Periods, produces a figure with 
  319.            the so-called hyperbolic components of the interior colored by 
  320.            period. For the full MSet, use the script MPERIODS.CMD or set 
  321.            maxiter = 10000 and maxperiod = 10. 
  322.         
  323.         Finally, select the desired palette. (1) YABMP Default Palette 
  324.         should generally be used. A modified (2) VGA/SVGA Default 
  325.         Palette is provided for comparison. If a user-defined palette 
  326.         map has previously been loaded, using (3) Load a Palette File 
  327.         on the Options Menu, then (3) User-Defined Palette File is 
  328.         available.                
  329.  
  330.  
  331.                 
  332.         The computation of the figure can be interrupted. Pressing Esc 
  333.         terminates the computation and returns you to the Main MENU, 
  334.         discarding the partially completed figure. Pressing Enter 
  335.         terminates the computation, but allows you to save and use the 
  336.         partial result. Press Esc **ONLY ONCE** and wait until the 
  337.         current line is completed. 
  338.         
  339.         After the figure is completed, press any key to see the Small 
  340.         Menu: 
  341.         
  342.         F3 Save asks you for a filename and saves the figure as a file. 
  343.         If you choose an existing filename, the existing figure file is 
  344.         not overwritten, but the figure is saved as TMP_???. BMP.   
  345.         
  346.         F4 Zoom produces a box for selecting a subregion of the figure, 
  347.         to compute and plot. Move the box about with the cursor keys 
  348.         and/or the cursor keys on the numeric keypad. Adjust the size of 
  349.         the box with PageUp and PageDown and/or with PageUp and Page Down 
  350.         on the numeric keypad. Press Enter to select a region or Esc to 
  351.         return to the Small Menu. If you select a region, you will have 
  352.         an opportunity to edit several parameters. You may want to 
  353.         decrease thickness and increase maxiter, if the selected region 
  354.         is small. minrecur = 1 should be retained, unless the figure is 
  355.         unsatisfactory. maxperiod should be increased if the region 
  356.         contains many interior (red) points. Use F5 Measure to determine
  357.         the correct value. 
  358.         
  359.         F5 Measure provides a crosshair to read the true coordinates of a 
  360.         point in a figure. Move it about with the cursor keys and/or the
  361.         cursor keys on the numeric keypad. Return to the Small Menu with
  362.         Esc. Press Enter to compute and display the period of a point. 
  363.         Suppose that you select a region that contains a small imbedded 
  364.         copy of the MSET and you wish to produce a blow-up in which this 
  365.         small copy occupies much of the screen. If you do not increase 
  366.         maxperiod, this small copy may be plotted a single point at a 
  367.         time. Determine the period of a point in the central cardioid of 
  368.         the small copy and use 5 times this as your new value of 
  369.         maxperiod. Press j or J to make a JSet figure, using the 
  370.         cursor location as c. 
  371.  
  372.         F6 Ray draws external rays over the figure. 
  373.         
  374.         F7 returns you to the Main MENU. 
  375.         
  376.  
  377.         2.4. Making a New JSet Figure. Item (4) of Main MENU. 
  378.              ________________________ 
  379.         
  380.         A JSET figure is made in essentially the same way as an MSet 
  381.         figure. Begin by entering the coordinates c_real and c_imag, of 
  382.         the point c in the complex plane that determines the figure. 
  383.         After a figure is computed or partially computed, you can use the 
  384.         Small Menu to select a subregion. The Small Menu works in the 
  385.         same way as described for MSet figures, above. 
  386.         
  387.  
  388.         2.5. Options Menu. Item (5) of Main MENU. 
  389.              ------------
  390.         
  391.         (1) Select Default Video Mode works in the same way as the 
  392.         initial selection, when you first run the program, as described 
  393.         above. You may make the selection permanent, saving it to a 
  394.         new BMPSCRN.CFG file, or not. You may also use this item to 
  395.         just view the currently selected video mode, using Esc to 
  396.         return to the Menu. 
  397.         
  398.         (2) Check Aspect-Ratio should enable you to set your screen 
  399.         controls so that figures are proportioned correctly. You can
  400.         also check the aspect-ratio by computing and printing the JSet
  401.         figure for c = 0; that is, using c_real = c_imag = 0. This
  402.         figure is the unit circle.
  403.         
  404.         By aspect-ratio, we mean the ratio of the width of an object to 
  405.         its height. The useful part of your screen, a single pixel, and a 
  406.         rectangle in the complex plane all have aspect ratios and these 
  407.         combine together to determine the proportions of your figures.  
  408.                 
  409.         Two displays are provided, as follows:  
  410.                
  411.             (1) Computed Unit Circle displays a computed circle inscribed 
  412.             in a square. Use your screen controls to render the square 
  413.             accurately square (measure it!). 
  414.         
  415.             (2) Raw pixels shows a circle in a square, which is 
  416.             maxypixels by maxxpixels square. For instance, in VGA 640 
  417.             x 480 modes, maxypixels = 480 and maxxpixels = 640. 
  418.             
  419.         (3) Load a Palette File allows you to select and load a *.PAL
  420.         palette file from your current directory. 
  421.  
  422.         (4) View Palette permits you to view the palette used for a 
  423.         given choice of color scheme and palette in the current 
  424.         default video mode. 
  425.         
  426.         (5) Displays this YABMP.DOC documentation file. 
  427.         
  428.         (6) Displays version and author information. 
  429.  
  430.         (7) Returns to Main MENU. 
  431.  
  432.  
  433.         2.6. Printing an existing figure file. Item (6) of Main MENU. 
  434.              --------------------------------
  435.         
  436.         This works in the same way as Viewing an existing figure file, 
  437.         but you have to select the printer orientation (portrait or 
  438.         landscape) and the number of dots per inch. Smaller values of dpi 
  439.         produce larger figures. 
  440.  
  441.         You may elect to send output to the first parallel printer port, 
  442.         LPT1:,  to an H-P *.PCL file, or to an *.HP File. A printer 
  443.         output file made from File.BMP is named File.PCL or File.HP 
  444.         and existing duplicate printer output files are overwritten.  
  445.         Use COPY /B to copy a *.PCL File to a LaserJet (tm) printer 
  446.         connected to a printer port. *.HP files are intended for 
  447.         inclusion in documents formatted with the TeX typesetting 
  448.         system, using the TeX "special" command. 
  449.         
  450.         In general, larger values of the parameter "thickness" should be 
  451.         used for printing than for viewing. 
  452.  
  453.  
  454.         2.7. Command File Processing.   
  455.              -----------------------   
  456.         Invoking YABMP with &Filename on the command line (Enter YABMP 
  457.         &Filename) causes YABMP to read the file and process the commands 
  458.         it contains. The format of a YABMP command file is as follows:
  459.  
  460.         
  461.         type M                       /* type is M or J             */
  462.  
  463.         point 0.30239579 -0.02468438 /* c_real c_imag  for type J  */
  464.  
  465.         loc -0.75 0.0 2.75           /* x_center y_center height   */
  466.         thick 0.25                   /* thickness                  */
  467.         maxi 100                     /* maxiter                    */
  468.         maxp 10                      /* maxperiod                  */
  469.         minr 1                       /* minrecur                   */
  470.         color 2                      /* color_scheme               */
  471.         pal 1                        /* palette                    */ 
  472.         mode 2                       /* mode                       */ 
  473.         name mset                    /* filename  to save,         */
  474.                                      /* without extension          */ 
  475.                                      
  476.         Keywords are written in lower case, with one keyword per line.
  477.         No delimiters are used. The color_scheme, palette, and video 
  478.         mode are specified by their selection numbers on the relevant 
  479.         Menus. Command files may have any name or extension.
  480.  
  481.         If (3) User-Defined Palette File is desired, the name of a 
  482.         *.PAL palette file in the current directory must be specified.
  483.         The required format is:
  484.  
  485.         pal 3  map NEON.PAL          /* palette                    */ 
  486.  
  487.         Syntax checking of command files is very primitive, so care 
  488.         should be taken in preparing them. 
  489.  
  490.         A collection of prepared command files, for producing the 
  491.         figures referred to in this documentation, is provided.
  492.         
  493.                                                       
  494.         2.8. User-Defined Palette File Structure 
  495.              -----------------------------------  
  496.  
  497.         A User-Defined Palette File can be used to produce amusing 
  498.         effects, when Color Scheme (3) Distance (points) Complement 
  499.         and Solid Interior is selected in a 256 color mode. With other
  500.         Color Schemes or 16 color modes, nothing very amusing results. 
  501.  
  502.         A YABMP *.PAL Palette File is a 256 line text file. Each line 
  503.         consists of a triple of integer intensities: b, g, r, in the 
  504.         order blue, green, red, delimited by two commas. Intensities 
  505.         may have any value, between 0 and 255, inclusive. Comments may 
  506.         be included on any line, after a space after the triple, but 
  507.         each line must begin with the triple. See the included sample 
  508.         *.PAL files.
  509.  
  510.         Each of the 256 colors is used in a specific way, which is not
  511.         user-modifiable, as follows: 
  512.  
  513.         color( 0 )  Background color of the blank screen, when 
  514.                     plotting begins. Its default value is  0, 0, 0
  515.                     (black). 
  516.                                      
  517.         color( 1 )  Complement color in Color Schemes 1 and 6.  
  518.                     Its default value is  21, 0, 0  (dark blue). 
  519.                     
  520.         color( 2 )  Color for points very near the boundary. 
  521.                     Its default value is  0, 155, 255  (bright 
  522.                     yellow). 
  523.                     
  524.         color( 3 )  Interior points. Its default value is  0, 0, 255  
  525.                     (bright red).
  526.  
  527.         color( 4 ) to color( 255 ) are used in ways that depend on 
  528.         Color Scheme and whether the number of colors is 256 or 16. 
  529.         Here are the formulas used to determine the colors of points 
  530.         of the complement of the set: 
  531.  
  532.         In 256 color modes:
  533.  
  534.         Color Scheme 1   color = 1 
  535.         Color Scheme 2   color = dist mod 224 + 32 
  536.         Color Scheme 3   color = dist mod 224 + 32 
  537.         Color Scheme 4   color = k mod (number of colors - 3) + 3 
  538.         Color Scheme 5   color = 1 or 4, accordingly as the imaginary
  539.                          part of the last value of z is positive or 
  540.                          negative. 
  541.         Color Scheme 6   color = 1 
  542.  
  543.         In 16 color modes: 
  544.  
  545.         Color Scheme 1   color = 1 
  546.         Color Scheme 2   color = (dist/16) mod 12 + 4 
  547.         Color Scheme 3   color = (dist/16) mod 12 + 4 
  548.         Color Scheme 4   color = k mod (number of colors - 3) + 3 
  549.         Color Scheme 5   color = 1 or 4, accordingly as the imaginary 
  550.                          part of the last value of z is positive or 
  551.                          negative. 
  552.         Color Scheme 6   color = 1 
  553.  
  554.         Here, dist is the distance in pixels from the point being 
  555.         computed to the boundary of the set. k is the number of 
  556.         iterations before escape. 
  557.         
  558.         
  559.         Part 3. A Bit of Mathematics, History, and Computer Graphics 
  560.                 ----------------------------------------------------
  561.         
  562.         To produce the most interesting mathematically correct figures, 
  563.         the user needs to know a bit about the underlying mathematics.  
  564.         
  565.  
  566.         3.1  The Fatou and Julia Sets of a Complex Function 
  567.              ----------------------------------------------
  568.        
  569.         We begin by considering a simple example. Let the function f, 
  570.         from the complex plane to the complex plane, be defined by f(z) = 
  571.         z²; that is, if z = x + i·y, then f(z) = (x² - y²) + i·(2xy). 
  572.        
  573.         First suppose that z is inside the unit circle; i.e., x² + y² < 
  574.         1. Then the iterates of f; that is, f(z), f(f(z)), f(f(f(z))), 
  575.         ... converge uniformly to the zero function. 
  576.        
  577.         Next suppose that z is outside the unit circle; i.e., x² + y² > 
  578.         1. Then the iterates of z converge to infinity or, to be more 
  579.         precise, to the function that maps each point to infinity. Each 
  580.         such point, either inside or outside the unit circle, has a 
  581.         neighborhood on which the iterates of f form a normal family and 
  582.         all such points comprise the Fatou Set of f. The Julia set of  f 
  583.         is the complement of the Fatou Set which, in this case, is just 
  584.         the unit circle. 
  585.  
  586.         To get YABMP to show you this Julia Set figure, first Select (4) 
  587.         Compute and Plot New JSet from the Main MENU. Then enter c_real = 
  588.         0, c_imag = 0 (so that the function is f(z) = z² + 0), thickness 
  589.         = 1.5, maxiter = 50, Coloring Scheme = 1, and Palette = 1. What 
  590.         you will see is a yellow circle, with red interior and blue 
  591.         exterior. The red points converge to 0, while the blue points 
  592.         "converge to infinity." The Julia Set is the circle, while all 
  593.         the red and blue points belong to the Fatou Set.  
  594.  
  595.         The formal definition, of the Fatou and Julia sets, is abstract 
  596.         and difficult: If a point z has a neighborhood U, such that the 
  597.         sequence of the iterates of f restricted to U form a normal 
  598.         family, then the point z is said to belong to the Fatou Set of f. 
  599.         Otherwise, if no such neighborhood exists, z is said to belong to 
  600.         the Julia Set, J(f), of f. In our example, the Julia Set is 
  601.         precisely the unit circle, but it is impossible to plot a really 
  602.         clean circle because the points of the circle do not exactly 
  603.         coincide with pixel centers.  
  604.  
  605.         About 1906, Pierre Fatou made an astonishing discovery, 
  606.         concerning the rational function f(z) = z²/(z² + 1). Fatou found 
  607.         that almost every point z converges to zero, under the iteration 
  608.         of f.  However, there remained an exceptional set of points that 
  609.         remain bounded away from zero, namely the Julia set of f. After 
  610.         the first world war Fatou, Gaston Julia and others took up the 
  611.         theoretical study of this phenomenon and obtained many 
  612.         interesting results. For instance, Fatou was able to prove that 
  613.         the Julia Set of his rational function is a Cantor Set. However, 
  614.         in the absence of machine computation, it was impossible to 
  615.         compute and plot figures. 
  616.  
  617.         Some time before June 1978, Robert Brooks and J. Peter Matelski, 
  618.         then Assistant Professors of Mathematics at the State University 
  619.         of New York at Stony Brook, made some of the first machine 
  620.         computed and plotted such figures (see References [1] and [6]).  
  621.         They studied the function   
  622.  
  623.         (1)                      f(z) = z² + c 
  624.                           
  625.         and made a number of computer plots, two of which are reproduced 
  626.         in [1]. Fig. 1 of [1] shows the JSet for c = 0.1 + i·0.6, which 
  627.         they defined as the set of points z which have a stable periodic 
  628.         orbit under the mapping (1).  Fig. 2 of [1] is the first full 
  629.         MSet figure. They defined the MSet as the set of points c, which 
  630.         have a stable periodic orbit under the mapping (1). 
  631.  
  632.         Brooks' and Matelski's figures were necessarily crude, since the 
  633.         only output device at their disposal was a line printer. Their 
  634.         figures consisted of asterisks printed on green striped paper. 
  635.         
  636.         Some time later, Benoit Mandelbrot, working at IBM with much 
  637.         better equipment, made much higher resolution computer pictures 
  638.         which, however, were mathematically incorrect. Mandelbrot thought 
  639.         and his figures showed that his set, which he called Q, consists 
  640.         of many well separated components or islands. 
  641.         
  642.         In 1982, Douady and Hubbard (see Reference [2]) defined the MSet 
  643.         to be the set of parameter values c, for which the map (1) has a 
  644.         bounded critical orbit or, equivalently, for which the map has a 
  645.         connected Julia Set. They proved that the MSet is connected and 
  646.         that the complement of the MSet is connected, thus providing a 
  647.         sound mathematical basis for the further study of the MSet and of 
  648.         the JSets of (1).  
  649.  
  650.  
  651.         3.2  Computer Graphics 
  652.              -----------------
  653.  
  654.         The most obvious way to attempt to compute and plot a figure of 
  655.         the MSet is to attempt to do it directly from its definition. To 
  656.         do this, we start with a point c, that corresponds to the center 
  657.         of a pixel on the screen. Beginning with z = 0, we just iterate  
  658.         z = z² + c until either (i) the modulus of z exceeds some large 
  659.         number M or (ii) a certain large number maxiter of iterations has 
  660.         been performed. In Case (i), the iterates are evidently diverging 
  661.         to infinity, so we can confidently color the pixel to indicate 
  662.         that it is an element of the complement of the MSet. In case 
  663.         (ii), where the modulus of the iterates has remained small after 
  664.         maxiter iterations have been performed, all we really know is 
  665.         that the iterates are not (yet) diverging to infinity. 
  666.        
  667.         Different colors, related to the number of iterations performed 
  668.         before z escaped from the disk of radius M, are often used to 
  669.         produce a more colorful figure. In Case (ii), when maxiter 
  670.         iterations have been performed without z escaping from the disk 
  671.         of radius M, we color the pixel to indicate that the point 
  672.         belongs to the MSet. That is, we assume that it will never 
  673.         escape. Note that the point c scans the screen, while z always 
  674.         starts from zero. 
  675.  
  676.         To produce a JSet figure, we select a complex number c, which 
  677.         remains fixed for the figure, and we speak of the JSet of the 
  678.         complex number c. We start with a point z, that corresponds to 
  679.         the center of a pixel on the screen. Then, we just iterate  
  680.         z = z² + c until either (i) the modulus of z exceeds some large 
  681.         number M or (ii) a certain large number maxiter of iterations has 
  682.         been performed and color the pixel accordingly. Note that here, c 
  683.         is fixed and z scans the screen. 
  684.        
  685.         This naïve method suffices to produce crude figures, of the kind 
  686.         usually made by available programs, but it cannot produce a 
  687.         mathematically accurate sharp figure. There are two reasons for 
  688.         this.  First of all, many points of JSets and many points near 
  689.         the boundary of the MSet take a very large number of iterations 
  690.         to escape. So, unless the maximum number of iterations is very 
  691.         large some points will be colored incorrectly. But there is a 
  692.         second, much more subtle reason why this method cannot produce 
  693.         accurate sharp figures. The boundaries of the MSet and of the 
  694.         JSets are extremely diaphanous. They are composed of many fine 
  695.         filaments, separated by mostly empty space or "holes," rather 
  696.         like lace. It is easily possible that, in scanning the screen, 
  697.         all of the points corresponding to the centers of pixels will 
  698.         fall in the "holes." 
  699.        
  700.         Let us try to understand this better, with the aid of the 
  701.         "Spiral" figure of the file MSHVL4.BMP. In VGA 640x480 mode, this 
  702.         figure consists of 41,935 pixels (of the 307,200 pixels on the 
  703.         entire screen), every one of which is actually diverging to 
  704.         infinity. Thus, every pixel center in this figure falls in a hole 
  705.         in the lace. Nevertheless, this region of the plane contains 
  706.         infinitely many interior points of the MSet and, in fact, 
  707.         infinitely many small imbedded copies of the MSet, itself.  
  708.         Successive further magnifications, of a detail in this figure, 
  709.         yields figures that look like MSHVL1, MSHVL2, and MSHVL3. 
  710.         
  711.         It is this second fact that prevented early computer figures from 
  712.         being correct (See References [5], [6]), and [8]. In fact, the 
  713.         production of realistic figures had to await the discovery of the 
  714.         Distance Estimate Formula (See Reference [5]), by William 
  715.         Thurston. Thurston's formula yields an estimate of the 
  716.         distance from the center of a pixel to the boundary of the 
  717.         set. The Distance Estimate Method involves the iteration of 
  718.         both the function and its derivative(s) until either (i) a 
  719.         good distance estimate can be made, (ii) the iterates escape, 
  720.         or (iii) a certain maxiter number of iterations has been made.  
  721.  
  722.         YABMP uses Thurston's Distance Estimate Formula in the following 
  723.         way. If the distance from a pixel to the boundary of the set is 
  724.         very small, say a pixel side or so, the pixel is colored bright 
  725.         yellow to indicate that the pixel is "near the boundary."  If a 
  726.         pixel is inside the set, it is colored bright red. Additionally, 
  727.         for MSet figures, an attempt is made to estimate the distance 
  728.         from the pixel, corresponding to an interior point of the set, to 
  729.         the boundary and this is used to color a disk red. If a pixel is 
  730.         found to lie outside the set, it is colored according to one of 
  731.         six selectable Complement Coloring Schemes.  With Scheme 1, 
  732.         Solid, the distance estimate is used to color a solid disc 
  733.         consisting entirely of blue points that are escaping to infinity. 
  734.         This yields the best run-time performance and, also, the most 
  735.         mathematically realistic figures. There are, after all, only two 
  736.         kinds of points: those that belong to the set and those that 
  737.         belong to its complement. Consequently, only two colors should be 
  738.         needed. However, by distinguishing between the yellow points near 
  739.         the boundary and the red interior points of the set, we can print 
  740.         good monochrome figures by printing the yellow points. 
  741.  
  742.         The implementation of the Distance Estimate Method, used by 
  743.         YABMP, is an adaptation of the recursive algorithm of Juval 
  744.         Fisher, given by him in his paper "Exploring the Mandelbrot 
  745.         Set," see [4], pp. 287-296. 
  746.                                
  747.         The MSet iteration process is always started with the initial 
  748.         value  z = 0. The function f(z) = z² + c has exactly one 
  749.         critical point at z = 0 (where the derivative f'(z) = 2·z is 
  750.         zero).  Consequently, if we know what happens in the neighbor-
  751.         hood of z = 0, we know what happens everywhere and, therefore, 
  752.         nothing further is to be learned by making figures with non-zero 
  753.         initial values of z. 
  754.                                            
  755.  
  756.                                  REFERENCES 
  757.                                  ----------
  758.  
  759.         [1] Robert Brooks and J. Peter Matelski, "The Dynamics of 
  760.         2-generator subgroups of PSL(2,C)," pp. 65-71, in "Riemann 
  761.         Surfaces and Related Topics: Proceedings of the 1978 Stony Brook 
  762.         Conference" (Irwin Kra and Bernard Maskit, Eds.),  Annals of 
  763.         Math. Studies vol. 97, Princeton University Press, 1981. 
  764.         Contains the first figure of the MSet and the JSet figure for 
  765.         c = 0.1 + 0.6·i. 
  766.  
  767.         [2] Adrien Duady et John Hamal Hubbard, "Itération des polynômes 
  768.         quadratique complexes," C. R. Acad. Sc. Paris, Série I, t. 294 
  769.         (18 janvier 1982), pp. 123-126.   
  770.   
  771.         [3] H.-O. Peitgen, P. H. Richter, et al., "The Beauty of 
  772.         Fractals," Springer Verlag, 1986.  Contains many good colored 
  773.         figures, including interesting details of the MSet and their 
  774.         locations (coordinates). 
  775.  
  776.         [4] H.-O. Peitgen, Dietmar Saupe, et al., "The Science of Fractal 
  777.         Images," Springer Verlag, 1988.  Contains more good figures, 
  778.         mathematical exposition, and pseudo-code for computational 
  779.         algorithms.
  780.                                
  781.         [5] John Milnor, "Self-Similarity and Hairiness in the Mandelbrot 
  782.         Set," pp. 211-257 of "Computers in Geometry and Topology", Edited 
  783.         by Tangora, Lecture Notes in Pure and Applied Mathematics, vol. 
  784.         114, Marcel Dekker Inc., 1989. Contains the derivation of the 
  785.         Thurston Distance Estimate Formula, many good technical 
  786.         references, and some very interesting figures. 
  787.  
  788.         [6] Steven G. Krantz, "Fractal Geometry," pp. 12-19, The 
  789.         Mathematical Intelligencer, vol. 11, No. 4, 1989 (Springer 
  790.         Verlag).  An interesting book review of [3] and [4], above. See 
  791.         also the letters to the editor, from Robert Brooks and Benoit 
  792.         Mandelbrot, in the following issue of The Mathematical 
  793.         Intelligencer, vol. 11, No. 5, 1989 (Springer Verlag). 
  794.        
  795.         [7] John Horgan, "Mandelbrot Set-To  ---  Did the father of 
  796.         fractals 'discover' his namesake set?", Scientific American, 
  797.         April 1990, pp. 30-34. 
  798.   
  799.         [8] John Milnor, "Dynamics in One Complex Variable: Introductory 
  800.         Lectures", April 1990, SUNY Stony Brook, Institute for 
  801.         Mathematical Sciences, Preprint # 1990/5. Elegant exposition, 
  802.         with some outstanding figures and a fine treatment of the 
  803.         problems of computer graphics. 
  804.                                                 
  805.  
  806.               Copyright, Disclaimer, Licenses, and All That Stuff         
  807.               ---------------------------------------------------
  808.  
  809.         The author of YABMP disclaims all warranties, either express or 
  810.         implied, and makes no claim as to the suitability of this 
  811.         software for any purpose. In no event shall either he or his 
  812.         Institution be liable for any damages whatsoever. 
  813.  
  814.         You may freely make copies of YABMP and give them to others, 
  815.         subject only to the condition that they be accompanied by the 
  816.         full documentation. 
  817.        
  818.         The author would appreciate your comments, suggestions, and bug 
  819.         reports. He can be reached at: 
  820.        
  821.                         Prof. Eugene Zaustinsky
  822.                         Department of Mathematics
  823.                         State University of New York
  824.                         Stony Brook, New York 11794-3561 
  825.        
  826.                         email: ezaust@math.sunysb.edu
  827.